/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package reportcenter.admin.ui;

import javax.swing.JComboBox;
import javax.swing.JComponent;
import org.springframework.richclient.form.AbstractForm;
import org.springframework.richclient.form.binding.swing.SwingBindingFactory;
import org.springframework.richclient.form.builder.TableFormBuilder;
import reportcenter.report.dominio.report.Report;

/**
 *
 * @author renan_luz
 */
public class AdminReportForm extends AbstractForm {

    private JComponent titleField;

    public AdminReportForm(Report report) {
        super(report);
        setId("adminReportForm");
    }

    @Override
    protected JComponent createFormControl() {
        TableFormBuilder formBuilder = new TableFormBuilder(getBindingFactory());
        formBuilder.setLabelAttributes("colGrId=label colSpec=right:pref");
        
        formBuilder.addSeparator(getMessage("adminReportForm.separator.title1"));
        formBuilder.row();
        titleField = formBuilder.add("title")[1];
        formBuilder.row();
        formBuilder.addTextArea("query");
        
        
        return formBuilder.getForm();
    }

    public boolean requestFocusInWindow() {
        return titleField.requestFocusInWindow();
    }
}
